Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chown: restore SUID and SGID bits #216

Merged
merged 1 commit into from
Sep 25, 2018

Conversation

giuseppe
Copy link
Member

be sure the SUID and SGID bits are not lost when we do
a chown.

Closes: containers/podman#1526

Signed-off-by: Giuseppe Scrivano [email protected]

be sure the SUID and SGID bits are not lost when we do
a chown.

Closes: containers/podman#1526

Signed-off-by: Giuseppe Scrivano <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Sep 25, 2018

LGTM

1 similar comment
@nalind
Copy link
Member

nalind commented Sep 25, 2018

LGTM

@nalind nalind merged commit 68332c0 into containers:master Sep 25, 2018
@runcom runcom mentioned this pull request Nov 9, 2018
@@ -45,10 +45,20 @@ func platformLChown(path string, info os.FileInfo, toHost, toContainer *idtools.
uid, gid = mappedPair.UID, mappedPair.GID
}
if uid != int(st.Uid) || gid != int(st.Gid) {
stat, err := os.Lstat(path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm missing something here, but I don't understand the reason for calling os.Lstat() here -- this function is already called with the info parameter, which is result of os.Lstat(path).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, I agree we can avoid Lstat here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants